using Typed.Configuration.ConfigSource;

namespace Typed.Configuration.Tests
{
    internal class StubSoruce : IStringConfigSource
    {
        private readonly string stubValue;
        private readonly bool success;

        public StubSoruce(bool success, string stubValue)
        {
            this.success = success;
            this.stubValue = stubValue;
        }

        #region IConfigSource Members

        public bool TryGetString(string fieldName, out string value)
        {
            value = (string) stubValue;
            return success;
        }

        #endregion
    }
}